package gps.monitor.common.tools.network;

import gps.monitor.common.core.network.AbstractConnectionConfig;
import lombok.Data;

/**
 * @author cyq
 * @date 2021/11/4
 * @desc talk is cheep,show me the code
 */
@Data
public class SimpleNettyConnectConfig extends AbstractConnectionConfig {

    private int soBackLog = 128;

    public static SimpleNettyConnectConfig clientConfig(String server, int port) {
        SimpleNettyConnectConfig config = new SimpleNettyConnectConfig();
        config.setRemoteAddress(server);
        config.setRemotePort(port);
        return config;
    }

    public static SimpleNettyConnectConfig serverConfig(int port) {
        SimpleNettyConnectConfig config = new SimpleNettyConnectConfig();
        config.setLitsenPort(port);
        return config;
    }
}
